# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Jobs.V2.Model.SearchJobsResponse do
  @moduledoc """
  Output only.

  Response for SearchJob method.

  ## Attributes

  *   `appliedCommuteFilter` (*type:* `GoogleApi.Jobs.V2.Model.CommutePreference.t`, *default:* `nil`) - The commute filter the service applied to the specified query. This
      information is only available when query has a valid CommutePreference.
  *   `appliedJobLocationFilters` (*type:* `list(GoogleApi.Jobs.V2.Model.JobLocation.t)`, *default:* `nil`) - The location filters that the service applied to the specified query. If
      any filters are lat-lng based, the JobLocation.location_type is
      JobLocation.LocationType#LOCATION_TYPE_UNSPECIFIED.
  *   `estimatedTotalSize` (*type:* `String.t`, *default:* `nil`) - An estimation of the number of jobs that match the specified query.

      This number is not guaranteed to be accurate. For accurate results,
      seenenable_precise_result_size.
  *   `histogramResults` (*type:* `GoogleApi.Jobs.V2.Model.HistogramResults.t`, *default:* `nil`) - The histogram results that match specified
      SearchJobsRequest.HistogramFacets.
  *   `jobView` (*type:* `String.t`, *default:* `nil`) - Corresponds to SearchJobsRequest.job_view.
  *   `matchingJobs` (*type:* `list(GoogleApi.Jobs.V2.Model.MatchingJob.t)`, *default:* `nil`) - The Job entities that match the specified SearchJobsRequest.
  *   `metadata` (*type:* `GoogleApi.Jobs.V2.Model.ResponseMetadata.t`, *default:* `nil`) - Additional information for the API invocation, such as the request
      tracking id.
  *   `nextPageToken` (*type:* `String.t`, *default:* `nil`) - The token that specifies the starting position of the next page of results.
      This field is empty if there are no more results.
  *   `numJobsFromBroadenedQuery` (*type:* `integer()`, *default:* `nil`) - If query broadening is enabled, we may append additional results from the
      broadened query. This number indicates how many of the jobs returned in the
      jobs field are from the broadened query. These results are always at the
      end of the jobs list. In particular, a value of 0 means all the jobs in the
      jobs list are from the original (without broadening) query. If this
      field is non-zero, subsequent requests with offset after this result set
      should contain all broadened results.
  *   `spellResult` (*type:* `GoogleApi.Jobs.V2.Model.SpellingCorrection.t`, *default:* `nil`) - The spell checking result, and correction.
  *   `totalSize` (*type:* `String.t`, *default:* `nil`) - The precise result count, which is available only if the client set
      enable_precise_result_size to `true` or if the response
      is the last page of results. Otherwise, the value will be `-1`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :appliedCommuteFilter => GoogleApi.Jobs.V2.Model.CommutePreference.t(),
          :appliedJobLocationFilters => list(GoogleApi.Jobs.V2.Model.JobLocation.t()),
          :estimatedTotalSize => String.t(),
          :histogramResults => GoogleApi.Jobs.V2.Model.HistogramResults.t(),
          :jobView => String.t(),
          :matchingJobs => list(GoogleApi.Jobs.V2.Model.MatchingJob.t()),
          :metadata => GoogleApi.Jobs.V2.Model.ResponseMetadata.t(),
          :nextPageToken => String.t(),
          :numJobsFromBroadenedQuery => integer(),
          :spellResult => GoogleApi.Jobs.V2.Model.SpellingCorrection.t(),
          :totalSize => String.t()
        }

  field(:appliedCommuteFilter, as: GoogleApi.Jobs.V2.Model.CommutePreference)
  field(:appliedJobLocationFilters, as: GoogleApi.Jobs.V2.Model.JobLocation, type: :list)
  field(:estimatedTotalSize)
  field(:histogramResults, as: GoogleApi.Jobs.V2.Model.HistogramResults)
  field(:jobView)
  field(:matchingJobs, as: GoogleApi.Jobs.V2.Model.MatchingJob, type: :list)
  field(:metadata, as: GoogleApi.Jobs.V2.Model.ResponseMetadata)
  field(:nextPageToken)
  field(:numJobsFromBroadenedQuery)
  field(:spellResult, as: GoogleApi.Jobs.V2.Model.SpellingCorrection)
  field(:totalSize)
end

defimpl Poison.Decoder, for: GoogleApi.Jobs.V2.Model.SearchJobsResponse do
  def decode(value, options) do
    GoogleApi.Jobs.V2.Model.SearchJobsResponse.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Jobs.V2.Model.SearchJobsResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
